package com.caiheng.api.service.event.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.caiheng.api.dao.event.EventPointQrInfoMapper;
import com.caiheng.api.dao.event.EventPointQrMapper;
import com.caiheng.api.entity.event.EventPlanTask;
import com.caiheng.api.entity.event.EventPointQr;
import com.caiheng.api.entity.event.EventPointQrInfo;
import com.caiheng.api.service.base.impl.BaseServiceImpl;
import com.caiheng.api.service.event.EventPointQrService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 地点二维码Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-12
 */
@Service
public class EventPointQrServiceImpl extends BaseServiceImpl<EventPointQrMapper, EventPointQr> implements EventPointQrService {

    @Resource
    private EventPointQrMapper eventPointQrMapper;
    @Resource
    private EventPointQrInfoMapper eventPointQrInfoMapper;

    @Override
    public EventPointQr getPointQr(int pointQrId, double lng, double lat) {
        EventPointQr pointQr = eventPointQrMapper.selectById(pointQrId);
        if(pointQr != null){
            QueryWrapper<EventPointQrInfo> qw = new QueryWrapper<>();
            qw.eq("point_qr_id", pointQrId);
            List<EventPointQrInfo> infoList = eventPointQrInfoMapper.selectList(qw);
            pointQr.setInfoList(infoList);
        }
        return pointQr;
    }

}
